/**
 * 
 */
package com.blueocean_health.care.management.transfer.client;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.blueocean_health.care.management.domain.base.SysResult;
import com.blueocean_health.care.management.transfer.client.OrderClient.HystrixClientFallback;
import com.blueocean_health.care.management.transfer.dto.OrderSelectInfoEntity;
import com.blueocean_health.care.management.transfer.dto.SelectOrderVo;



/**
* @Title: TestClient.java
* @Package com.blueocean_health.care.management.transfer.client
* @author lcx
* @date 2018年7月3日
* @version V1.0
*/
@FeignClient(value = "orderserver",fallback = HystrixClientFallback.class)
public interface  OrderClient {
	//查询订单列表
	@RequestMapping(value = "order/list",method = RequestMethod.POST)
	
	SysResult selectOrderList( SelectOrderVo order);
	//查询关联订单
	@RequestMapping(value = "order/relationList",method = RequestMethod.POST)
	SysResult relationList( SelectOrderVo order);
	//导出excel
	@RequestMapping(value = "order/listforExcel",method = RequestMethod.POST)
	List<OrderSelectInfoEntity> listforExcel( SelectOrderVo order);
	//查看订单详情
	@RequestMapping(value = "order/query",method = RequestMethod.POST)
	SysResult selectOrderInfo(SelectOrderVo order);
	 @Component
	  static class HystrixClientFallback implements OrderClient {
		    private static Logger logger = LoggerFactory.getLogger(HystrixClientFallback.class);


		@Override
		public SysResult selectOrderList(SelectOrderVo order) {
			logger.info("异常发生，进入fallback方法，接收的参数："+order);
			return SysResult.error("访问超时 请重试");
		}


		/* (non-Javadoc)
		 * @see com.blueocean_health.care.management.transfer.client.OrderClient#relationList(com.blueocean_health.care.management.transfer.dto.SelectOrderVo)
		 */
		@Override
		public SysResult relationList(SelectOrderVo order) {
			// TODO Auto-generated method stub
			return null;
		}


		/* (non-Javadoc)
		 * @see com.blueocean_health.care.management.transfer.client.OrderClient#listforExcel(com.blueocean_health.care.management.transfer.dto.SelectOrderVo)
		 */


		/* (non-Javadoc)
		 * @see com.blueocean_health.care.management.transfer.client.OrderClient#listforExcel(com.blueocean_health.care.management.transfer.dto.SelectOrderVo)
		 */
		@Override
		public List<OrderSelectInfoEntity> listforExcel(SelectOrderVo order) {
			// TODO Auto-generated method stub
			return null;
		}


		/* (non-Javadoc)
		 * @see com.blueocean_health.care.management.transfer.client.OrderClient#selectOrderInfo(com.blueocean_health.care.management.transfer.dto.SelectOrderVo)
		 */
		@Override
		public SysResult selectOrderInfo(SelectOrderVo order) {
			// TODO Auto-generated method stub
			return null;
		}
	  }
}
